home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / cacoph10 / readme.txt < prev    next >
Encoding:
Text File  |  1994-04-17  |  9.7 KB  |  242 lines

  1. ╔══════════════════════════════════════════════╤═════════════════════════════╗
  2. ║░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░┤K░E░N░J░I░░░B░A░U░G░H░A░M░'░S║
  3. ║░░████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░┼─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─╢
  4. ║░░█░░░░░░██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  5. ║░░█░░░░░░░█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  6. ║░░█░░░░░░██░░░░░░░░░░░░░░░░░╔═════════════════════════════════════════╗░░░░░║
  7. ║░░████████░░░░░░██████░░░░░░║C   A   C   O   P   H   O   N   Y   !   !║░░░░░║
  8. ║░░█░░░░░░░░░░░░██░░░░██░░░░░╚═════════════════════════════════════════╝░░░░░║
  9. ║░░█░░░░░░░░░░░░█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  10. ║░░█░░░░░░░░░░░░█░░░░░░░░░░░░░░░V░░░░░N░░┐░░░┌─┐░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  11. ║░░░░░░░░░░░░░░░██░░░░██░░░░░░░░░E░░░O░░░┴░■░└─┘░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  12. ║░░░░░░░░░░░░░░░░██████░░░░░░░░░░░R░I░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░║
  13. ║░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░S░░░░░░░░░░░░░░░░░LET THE NIGHTMARE BEGIN!║
  14. ╚════════════════════════════════════════════════════════════════════════════╝
  15.  
  16.  
  17.  
  18.  
  19.                   ------****<<< INTRODUCTION >>>****------
  20.  
  21. Welcome to the world of inane prattling on the PC speaker!  Now you too can
  22. create irksome single voice mayhem and two part cacophony on the PC speaker!
  23. Furthermore, you can sit here and read an introduction section in which every
  24. sentence ends in an exclamation point!
  25.  
  26. This product contains a header file and library for Borland C and C++
  27. products!  These files make PC speaker music programming fun and easy!
  28.  
  29. Now sit and back and be awed at the amazing sounds that your PC speaker can
  30. produce!  You will hear sounds that you never thought were possible!  You
  31. will either no longer feel the need to buy a sound card or you will feel
  32. embarrassed that you already have and try to return it or sell it to some
  33. unsuspecting fool who has not yet seen the wonders of PC Cacophony 1.0!
  34.  
  35. Remember, the only limits are your imagination and your PC speaker (which of
  36. course is infinite in its capabilities)!
  37.  
  38.  
  39.  
  40.                    ------****<<< DISCLAIMER >>>****------
  41.  
  42. These files, to the best of my knowledge, bear coincidences to other
  43. files only through some freakish mishap of cosmic circumstance.  Furthermore,
  44. these files do not blow up, infect, corrupt, implode, or cause any other
  45. damage to any of the components of my system, and I am completely
  46. unresponsible for any damage brought upon any users of these files.  These
  47. files are FREEWARE and may therefore be distributed freely, but any
  48. distribution of any of these files must include this disclaimer.
  49.  
  50. All files are copyright (C) 1994 Kenji Baugham.
  51.  
  52.  
  53.  
  54.                   ------****<<< COMPATIBILITY >>>****------
  55.  
  56. The library file and all cpp files are compatible with Borland C++ (the
  57. library functions can be called from C as well).  They were written on
  58. Borland C++ 3.1 by Kenji Baugham with Matthew Amster as a programming
  59. consultant.  Kenji can be addressed on the Internet at:
  60.  
  61.     cbaugham@pomona.claremont.edu
  62.  
  63. I suppose you also need a PC speaker for this to work, but that's kind of
  64. standard so I don't know why I even mentioned it.
  65.  
  66.  
  67.  
  68.                ------****<<< SINGLE VOICE MAYHEM >>>****------
  69.  
  70. The basic function of PC Cacophony is the note() function.  Note() will
  71. generate a single tone as follows:
  72.  
  73.     note( pitch, duration );
  74.  
  75. Pitch is the note to be played.  Pitch can range from A to G within seven
  76. octaves.  An "A" in the third octave is notated A3, a "B" in the fifth octave
  77. is notated B5, and so on.  A4 is A440.  The octaves begin with A, so A3 is
  78. lower pitched than C3.  Thus the entire range of notes runs from A1 to G7.
  79. Accidentals are marked with F for flat and S for sharp in the form of AF2 for
  80. "A flat" in the second octave and AS2 for "A sharp" in the second octave.
  81.  
  82. Duration is the length of the note.  Duration can range from sixteenth notes
  83. (N16) to whole notes (N1).  The following chart displays all possible note
  84. durations:
  85.  
  86.     N16   sixteenth note
  87.     TN16  sixteenth note triplet
  88.     N8    eighth note
  89.     DN8   dotted eighth note
  90.     TN8   eighth note triplet
  91.     N4    quarter note
  92.     DN4   dotted quarter note
  93.     TN4   quarter note triplet
  94.     N2    half note
  95.     DN2   dotted half note
  96.     N1    whole note
  97.  
  98. An example follows.  For those trumpet players out there, this is a dotted
  99. half note of "B flat" in the fourth octave:
  100.  
  101.     note( BF4, DN2 );
  102.  
  103. Durations can also be joined together when a note length that is note
  104. described above is desired.  The following examples will play two tied
  105. whole notes and an eighth note triplet tied to a half note respectively:
  106.  
  107.     note( C3, N1 + N1 );
  108.     note( C3, TN8 + N2);
  109.  
  110. The note() function can also be used to indicate rests.  When this is
  111. desired, REST should be used for the pitch argument.  The following example
  112. shows a half note rest:
  113.  
  114.     note( REST, N2 );
  115.  
  116.  
  117.  
  118.                 ------****<<< TWO PART CACOPHONY >>>****------
  119.  
  120. Two part PC speaker music requires a bit more planning.  The function
  121. chord() follows the following paradigm:
  122.  
  123.     chord( pitch1, pitch2, duration );
  124.  
  125. Pitch1 and pitch2 are the pitches of the two notes to be played.  Duration
  126. has the same usage as it does in the note() function.  The difficult part
  127. of two part cacophony is in the creation of two part monsterpieces in which
  128. the two parts have different rhythms.  The technique for doing this is
  129. explained in the slurring section.
  130.  
  131. The REST parameter can also be used in the chord function, and while this is
  132. never necessary, it can result in more consistent formatting.  The following
  133. example shows how this could work:
  134.  
  135.     chord( C3, REST, N4 );
  136.     chord( C3, G3, N4 );
  137.     chord( REST, G3, N4 );
  138.     chord( REST, REST, N4 );
  139.     chord( C4, C4, N2 );
  140.  
  141. While it may seem somewhat redundant to use the chord function for single
  142. notes, it maintains a more consistent and readable pattern when single notes
  143. and rests are the exceptions in a primarily two-part song.
  144.  
  145.  
  146.  
  147.                      ------****<<< TEMPO >>>****------
  148.  
  149. The tempo of the music can be adjusted by changing the global variable
  150. tempo defined in music.h.  The default tempo is 100.  Higher tempo values
  151. will generate a faster speed.  Tempo works as a percentage, so 150 is 150%
  152. as fast as 100, 50 is 50% as fast as 100, and so on.  An example for setting
  153. tempo to 125 is as follows:
  154.  
  155.     tempo = 125;
  156.  
  157. Tempo can be changed at any point within the code.  I should mention again
  158. that the music.h file does create and use a global variable "tempo".  Hence,
  159. "tempo" can not be declared in any programs that include music.h.
  160.  
  161.  
  162.  
  163.                      ------****<<< SLURRING >>>****------
  164.  
  165. Slurring can be achieved with the schord(), snote(), and vsnote() commands.
  166. This will avoid the delay between notes, allowing notes to blend into one
  167. another.  Snote() is a slurred note, schord() is a slurred chord, and vsnote()
  168. is a slurred vibrato note.  Except for the lack of delay, these functions
  169. operate identically to their non-slurred counterparts.
  170.  
  171. Aside from blending the notes, slurring may often be necessary for quick
  172. runs, as the pauses between notes might create an excessively staccato effect.
  173. Slurring is also very useful with chords in creating a two part cacophony in
  174. which the two parts play completely different rhythms.  This may take some
  175. effort with more complicated patterns of rhythm interplay.  The basic idea
  176. is that a new chord() command is issued each time either of the notes is to
  177. change, but both notes need not change.  Consider the following example:
  178.  
  179.     schord( C3, C1, N4 );
  180.     schord( C3, G1, N4 );
  181.     schord( E3, G1, N4 );
  182.     schord( E3, G0, N8 );
  183.     chord( E3, C1, N8 );
  184.  
  185. In this example, the upper part will play two half notes, whereas the second
  186. part will play a quarter note, a half note, and two eighth notes.
  187.  
  188. Note that if a slurred note or chord is not followed by another note, the last
  189. note played will not stop until another note is played.  This may continue
  190. when the program has stopped running and can be quite irritating.  Hence,
  191. unless you enjoy droning tones it would be wise to always end with a
  192. non-slurred note or chord.
  193.  
  194.  
  195.  
  196.                     ------****<<< VIBRATO >>>****------
  197.  
  198. Vibrato is really quirky because of my limited programming knowledge.
  199. The length of vibrato notes may sometimes be shorter than expected, and
  200. very short notes may not play at all.  I have tried to remedy the problem,
  201. but it's source eludes me as of yet, and I could only attempt a marginal
  202. solution which makes it a bit smoother.
  203.  
  204. Vibrato is implemented through the vnote() and vsnote() functions, which
  205. operate much like the note() and snote() functions.  Vnote() and vsnote() will
  206. create vibrato and slurred vibrato notes respectively.  Vibrato chords are not
  207. possible.  Here is an example of each:
  208.  
  209.     vsnote( E4, N1 );
  210.     vnote( A5, N1 );
  211.  
  212. In general, if vibrato is reserved for long notes ( Half notes at least ),
  213. then there will be only slight rhythmic difficulties.  This can often be
  214. remedied by adding or subtracting sixteenth notes to the length of the note.
  215. Thus, a vibrato whole note in some cases may need to be as follows:
  216.  
  217.     vnote( C2, N1 + N16 );
  218.  
  219.  
  220.  
  221.                     ------****<<< SYNCOPATION >>>****------
  222.  
  223. Jazz syncopation can be attained with the use of sixteenth note triplets in
  224. the place of two eighth notes.  The first eighth note should be replaced
  225. with the first two triplets, and the second eighth note should be replaced
  226. with the third triplet.  Consider the following example:
  227.  
  228.     note( EF3, N8 );
  229.     note( F3, N8 );
  230.  
  231. This could be replaced with the following to create a jazzier feel.
  232.  
  233.     note( EF3, TN16 + TN16 );
  234.     note( F3, TN16 );
  235.  
  236. An example of syncopation can be seen in the file bluemonk.cpp.
  237.  
  238.  
  239.  
  240.                    ------****<<< OUTRODUCTION >>>****------
  241.  
  242. There, now that wasn't so bad now, was it?